home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
nt
/
ntkb.zip
/
NTKB.EXE
/
Q102
/
5
/
55.TXT
< prev
next >
Wrap
Text File
|
1993-11-16
|
5KB
|
125 lines
DOCUMENT:Q102555 04-NOV-1993 [W_NT]
TITLE :How Windows NT Handles Floating-Point Calculations
PRODUCT :Windows NT
PROD/VER:3.10
OPER/SYS:WINDOWS
KEYWORDS:
--------------------------------------------------------------
The information in this article applies to:
- Microsoft Windows NT operating system, version 3.1
- Microsoft Windows NT Advanced Server, version 3.1
--------------------------------------------------------------
SUMMARY
=======
Each thread has its own general register set (provided by the kernel)
and its own floating-point state. However, the floating-point support
available in a specific instance depends on the subsystem or component
in question.
Below is a list of various components and environments and what type
of floating-point support is present for them.
MORE INFORMATION
================
Win32
-----
Floating-point support is available to any thread running in the Win32
or POSIX subsystem.
This is true even on x86 machines that do not have floating-point
hardware. The floating-point instructions are emulated automatically
for the thread.
This feature allows people writing code in higher level languages,
such as C, to assume floating-point support. The compiler generates
the appropriate floating-point machine code. In addition, some
standard floating-point functions allow applications to use
floating-point exceptions in a portable manner. [For more information,
see the header file FPIEE.H and the filter function fpieee_flt().]
POSIX
-----
Again, POSIX applications can be created with the assumption of
available floating-point support.
Note that the POSIX standard does not define a way to enable
floating-point exceptions, so POSIX applications that do so must rely
on some system-specific features. Under Windows NT, a POSIX
application can enable floating exceptions by using _controlfp().
Floating-point exceptions can then be caught by SIGFPE, or, if the
application needs to do more than simply catch the exception, by
fpieee_flt().
MS-DOS/WOW: x86
---------------
MS-DOS and WOW applications are run directly by the processor in
virtual-86 mode. An MS-DOS/WOW application has access to the
floating-point hardware just as it would appear in MS-DOS. (If no
floating-point hardware is present, no emulation is provided for the
application.)
MS-DOS/WOW: Non-x86
-------------------
When run on a RISC-based computer, or other non-x86 machine using the
Windows/NT 80286 emulation code, the 80287 floating-point instructions
are directly emulated. The MS-DOS/WOW application behaves as if an
80287 processor were present.
OS/2 (Supported Only on x86 Versions of Windows NT)
---------------------------------------------------
Floating-point support in this subsystem matches that of OS/2: if
there's no floating-point hardware installed, the OS/2 application is
expected to provide its own emulation.
Device Drivers: x86
-------------------
On x86 platforms, a driver cannot use the coprocessor. Moreover, using
any floating-point instruction (including fnsave or fwait) in the
driver could cause either corruption of the user's numeric state or a
bug check.
Device Drivers: MIPS/Alpha
--------------------------
For non-ISR time (that is, execution that does not occur during the
interrupt service routine [ISR]), floating-point support can be
assumed. At ISR time, floating-point support is available so long as
the driver registered the ISR with IoConnectInterrupt and passed
FloatingSave as TRUE. This causes the system to save and restore the
volatile floating-point registers around the associated ISR.
Note that these functions on RISC-based computers use floating-point:
RtlFillMemory(), RtlZeroMemory(), RtlCopyMemory(), RtlMoveMemory(). If
an ISR calls any of these functions, it must connect to the interrupt
with FloatingSave=TRUE on a MIPS.
Additional reference words: 3.10
KBCategory:
KBSubCategory: 32ap
=============================================================================
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1993.